public class J2104 {
    public static int find(int[] arr){
        int k = arr.length;
        int m = 0;
        for(int i = 0; i < k; i++){
            int count = k / 2;
            for(int j = 0; j < k; j++){
                if(arr[i] == arr[j] && i != j){
                    count++;
                }
            }
            if(count > (k / 2)){
                return arr[i];
            }
        }
        return -Integer.MAX_VALUE;
    }

    public static void main(String[] args) {
        int[] Nums = new int[]{2,2,1,1,1,2,2};
        System.out.println(find(Nums));
    }
}
